cmake_minimum_required(VERSION 3.10)
project(HttpServer)

set(CMAKE_CXX_STANDARD 11)

if (CMAKE_COMPILER_IS_GNUCXX)
    set(CMAKE_CXX_FLAGS "-std=c++11 ${CMAKE_CXX_FLAGS}")
endif (CMAKE_COMPILER_IS_GNUCXX)

# jsoncpp spdlog libevent
include(FindPkgConfig)
pkg_check_modules(DEPENDS_LIBS REQUIRED jsoncpp>=1.4.0 spdlog>=1.3.1 libevent>=2.1.0)
include_directories(. ${DEPENDS_LIBS_INCLUDE_DIRS})
link_directories(${DEPENDS_LIBS_LIBRARY_DIRS})
link_libraries(${DEPENDS_LIBS_LIBRARIES})

# boost::timer
find_package(Boost 1.67.0 REQUIRED COMPONENTS timer)
include_directories(${Boost_INCLUDE_DIRS})
link_libraries(${Boost_LIBRARIES})

add_subdirectory(unittests)
